package com.itsitio.registeradmin.web.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.servlet.ModelAndView;

import com.itsitio.registeradmin.web.UserContext;


/**
 * BaseController	
 *
 */
@Controller
public class BaseController {

	protected ModelAndView forward1(String view, Map<String, Object> model){
		
		model.put("content", "/WEB-INF/jsp/"+view+".jsp");
		return new ModelAndView("template", model);
	}
	
	protected String forward(String view, Model model){
		model.addAttribute("content", "/WEB-INF/jsp/"+view+".jsp");
		return "template";
	}
	

	protected UserContext getUserContext(HttpServletRequest request){
		return (UserContext) request.getSession().getAttribute("userContext");
	}
	
}